import yaml

class LinkData(object):
	yaml_str = str
	parent = str
	# more...

	def __init__(self, yaml_str = '', parent = ''):
		if yaml_str and (parent):
			raise ValueError()
		elif not yaml_str:
			self.parent = parent
			# ...
		else:
			data = yaml.load(yaml_str)
			self.parent = data.get('parent')
			# ...

	def ToString(self):
		return yaml.safe_dump({'parent': self.parent})

